package com.rd.student.jike.class1.fangzhou.day0731;

import java.util.ArrayList;

public class Test05 {
    public static void main(String[] args) {
        ArrayList<Integer> allList = new ArrayList<>();
        int[] allArr = new int[50];
        for(int i = 0;i<50;i++){
            allArr[i] = i;
        }
        for (int i = 0; i < allArr.length; i++) {
            allList.add(allArr[i]);
        }

        System.out.println(allList.size());

        for (int i = 0; i < 50-20; i++) {
            int random = (int) (Math.random() * allList.size());
            System.out.println(allList.get(random));
            System.out.println("随机并移除" + allList.get(random));
            allList.remove(random);
        }

        System.out.println(allList.size());
        System.out.println(allList);
    }
}
